varying vec4 PositionES;  // vertex position in eye space
varying vec3 NormalES;

varying vec3 Ray_O;
varying vec3 Ray_D;

uniform mat4 invModelView;
uniform sampler3D volTex;
uniform sampler2D testTex;

void main()
{
    gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;

    gl_TexCoord[0] = gl_MultiTexCoord0;

    PositionES = gl_ModelViewMatrix * gl_Vertex; 
    NormalES   = gl_NormalMatrix    * gl_Normal;

    vec4 center = {0.0, 0.0, 0.0, 1.0};
    Ray_O = (invModelView * center).xyz;
    Ray_D = gl_Vertex.xyz - Ray_O;

    gl_FrontColor = gl_Color;
}